home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / man / cat3 / XmGetSecondaryResourceData.z / XmGetSecondaryResourceData
Encoding:
Text File  |  2003-11-18  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       _X_m_G_e_t_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a - A function that provides    access
  10.       to secondary widget resource data
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       #include <Xm/Xm.h>
  14.  
  15.       Cardinal XmGetSecondaryResourceData (wwwwiiiiddddggggeeeetttt____ccccllllaaaassssssss,,,, sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn)
  16.            _W_i_d_g_e_t_C_l_a_s_s       wwwwiiiiddddggggeeeetttt____ccccllllaaaassssssss;
  17.            _X_m_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a**sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn;
  18.  
  19.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.       Some Motif widget classes (such as Gadget, Text, and
  21.       VendorShell) have resources that are not accessible via the
  22.       functions _X_t_G_e_t_R_e_s_o_u_r_c_e_L_i_s_t and _X_t_G_e_t_C_o_n_s_t_r_a_i_n_t_R_e_s_o_u_r_c_e_L_i_s_t.
  23.       In order to retrieve the descriptions    of these resources, an
  24.       application must use _X_m_G_e_t_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a.
  25.  
  26.       When a widget    class has such resources, this function
  27.       provides descriptions    of the resources in one    or more    data
  28.       structures.  _X_m_G_e_t_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a takes    a widget class
  29.       argument and returns the number of these data    structures
  30.       associated with the widget class.  If    the return value is
  31.       greater than 0, the function allocates and fills an array of
  32.       pointers to the corresponding    data structures.  It returns
  33.       this array at    the address that is the    value of the
  34.       sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn    argument.
  35.  
  36.       The type _X_m_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a is a    pointer    to a structure
  37.       with two members that    are useful to an application:
  38.       rrrreeeessssoooouuuurrrrcccceeeessss, of    type _X_t_R_e_s_o_u_r_c_e_L_i_s_t, and nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss,    of
  39.       type _C_a_r_d_i_n_a_l.  The rrrreeeessssoooouuuurrrrcccceeeessss    member is a list of the    widget
  40.       resources that are not accessible using Xt functions.     The
  41.       nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss    member is the length of    the rrrreeeessssoooouuuurrrrcccceeeessss list.
  42.  
  43.       If the return    value is greater than 0,
  44.       _X_m_G_e_t_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a allocates memory that the
  45.       application must free.  Use _X_t_F_r_e_e to    free the resource list
  46.       in each structure (the value of the rrrreeeessssoooouuuurrrrcccceeeessss    member), the
  47.       structures themselves, and the array of pointers to the
  48.       structures (the array    whose address is
  49.       sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn).
  50.  
  51.       wwwwiiiiddddggggeeeetttt____ccccllllaaaassssssss
  52.            Specifies the widget class for which secondary resource
  53.            data is to be retrieved.
  54.  
  55.       sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn
  56.            Specifies a pointer to an array of
  57.            _X_m_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a pointers    to be returned by this
  58.            function.  If the widget    class has no secondary
  59.            resource    data (i.e., if the value returned by the
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 11/11/03)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
  71.  
  72.  
  73.  
  74.            function    is 0), the function returns no meaningful
  75.            value for this argument.
  76.  
  77.      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  78.       Returns the number of    secondary resource data    structures
  79.       associated with this widget class.
  80.  
  81.      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  82.       The following    example    uses _X_m_G_e_t_S_e_c_o_n_d_a_r_y_R_e_s_o_u_r_c_e_D_a_t_a    to
  83.       print    the names of the secondary resources of    the Motif Text
  84.       widget and then frees    the data allocated by the function:
  85.       XmSecondaryResourceData * block_array    ; Cardinal num_blocks,
  86.       i, j ; if (num_blocks    = XmGetSecondaryResourceData
  87.       (xmTextWidgetClass,
  88.                                &block_array))
  89.       {
  90.         for    (i = 0;    i < num_blocks;    i++) {
  91.           for (j = 0 ; j < block_array[i]->num_resources; j++) {
  92.         printf("%s\n", block_array[i]-
  93.       >resources[j].resource_name);
  94.           }
  95.           XtFree((char*)block_array[i]->resources);
  96.           XtFree((char*)block_array[i]);
  97.         }
  98.         XtFree((char*)block_array);    }
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 11/11/03)
  130.  
  131.  
  132.  
  133.